<!doctype html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>{{.install_name}}</title>
		<link rel="stylesheet" href="/static/css/install.css" />
	</head>
	<body>
		<div class="wrap">
			<div class="header">
				<h1 class="header-title">{{.install_name}}</h1>
				<div class="header-install">&nbsp;&nbsp;安装向导</div>
				<div class="header-version">版本：{{.version}}</div>
			</div>
			<div class="step">
				<ul>
					<li>{{.step_html}}</li>
				</ul>
			</div>
<!-- header -->			

	<div class="section">
		<div class="main install">
			<ul id="loginner"></ul>
		</div>
	</div>
	<div class="btn-box">
		<a href="javascript:;" class="btn_old" id="installloading">
			<img src="/static/images/install/loading.gif" align="absmiddle">&nbsp;正在安装...
		</a>
	</div>
	<script src="/static/js/install/jquery-1.17.2.min.js"></script> 
	<script type="text/javascript">
		var n=0;
		var config_params = "{{.config_params}}";
		var data = {"sys_config":config_params};
		$.ajaxSetup ({ cache: false });
		function reloads(n) {
			var url =	"/install?action=create_data&n="+n;
			$.ajax({
				type: "POST",		
				url: url,
				data: data,
				dataType: 'json',
				success: function(data){
					$('#loginner').append(data.msg);
					if(data.code == 1){
						reloads(data.count);
					}
					if(data.code == 0){
						$('#installloading').removeClass('btn_old').addClass('btn').html('继续安装').unbind('click').click(function(){
							reloads(0);
						});
						alert('安装已停止！');
					}
					if(data.code == 2){
						$('#installloading').removeClass('btn_old').addClass('btn').attr('href','/installSuccess').html('安装完成...');
						setTimeout(function(){
							window.location.href='/installSuccess';
						},5000);
					}
				}
			});
		}
		$(function(){
			reloads(n);
		})
	</script> 

<!-- footer -->
		</div>
		<div class="footer"> {{.footer_info}} </div>
	</body>
</html>